import React, {Component} from 'react';

class App extends Component {
    state = {
        buttonState: true
    }

    changeButtonState = () => {
        this.setState({
            buttonState: !this.state.buttonState
        })
    }

    render() {
        return (<div>
            <button onClick={this.changeButtonState}>{this.state.buttonState ? '收藏' : '取消收藏'}
            </button>
        </div>);
    }
}

export default App;